﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// CRM客户基础输入参数
/// </summary>
public class CRMCustomerBaseInput
{
    /// <summary>
    /// 客户名称
    /// </summary>
    public virtual string CustName { get; set; }

    /// <summary>
    /// 客户负责人
    /// </summary>
    public virtual long CustLeadId { get; set; }

    /// <summary>
    /// 是否关注
    /// </summary>
    public virtual int IsCollect { get; set; }

    /// <summary>
    /// 客户来源
    /// </summary>
    public virtual int CustomerSource { get; set; }

    /// <summary>
    /// 紧急联系人
    /// </summary>
    public virtual string? ContactName { get; set; }

    /// <summary>
    /// 手机号码
    /// </summary>
    public virtual string MobilePhone { get; set; }

    /// <summary>
    /// 电话号码
    /// </summary>
    public virtual string Telephone { get; set; }

    /// <summary>
    /// 客户级别
    /// </summary>
    public virtual int CustomerLevel { get; set; }

    /// <summary>
    /// 客户状态
    /// </summary>
    public virtual int CustomerStatus { get; set; }

    /// <summary>
    /// 客户规格
    /// </summary>
    public virtual int CustomerSpecification { get; set; }

    /// <summary>
    /// 下次联系时间
    /// </summary>
    public virtual DateTime? NextContactDate { get; set; }


    /// <summary>
    /// 区县
    /// </summary>
    public virtual List<long> DistrictList { get; set; }

    /// <summary>
    /// 所在省
    /// </summary>
    public virtual long? Province { get; set; }

    /// <summary>
    /// 所在市
    /// </summary>
    public virtual long? City { get; set; }

    /// <summary>
    /// 区县
    /// </summary>
    public virtual long? District { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    public virtual string DetailedAddress { get; set; }

    /// <summary>
    /// 最后跟进记录
    /// </summary>
    public virtual string LastFollowUpRecord { get; set; }

    /// <summary>
    /// 最后跟进时间
    /// </summary>
    public virtual DateTime? LastFollowUpTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    public virtual int OrderNo { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public virtual DateTime? CreateTime { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public virtual DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 创建者Id
    /// </summary>
    public virtual long? CreateUserId { get; set; }

    /// <summary>
    /// 创建者姓名
    /// </summary>
    public virtual string? CreateUserName { get; set; }

    /// <summary>
    /// 修改者Id
    /// </summary>
    public virtual long? UpdateUserId { get; set; }

    /// <summary>
    /// 修改者姓名
    /// </summary>
    public virtual string? UpdateUserName { get; set; }

    /// <summary>
    /// 软删除
    /// </summary>
    public virtual bool IsDelete { get; set; }

}

/// <summary>
/// CRM客户分页查询输入参数
/// </summary>
public class PageCRMCustomerInput : BasePageInput
{
    /// <summary>
    /// 关键字查询
    /// </summary>
    public string? SearchKey { get; set; }

    /// <summary>
    /// 查询类型  0：全部 1：我的客户 2：公海客户
    /// </summary>
    public int SelectType { get; set; } = 1;


    /// <summary>
    /// 客户名称
    /// </summary>
    public string? CustName { get; set; }

    /// <summary>
    /// 客户负责人
    /// </summary>
    public long? CustLeadId { get; set; } =-1;

    /// <summary>
    /// 是否关注
    /// </summary>
    public int? IsCollect { get; set; }

    /// <summary>
    /// 客户来源
    /// </summary>
    public int? CustomerSource { get; set; }

    /// <summary>
    /// 紧急联系人
    /// </summary>
    public string? ContactName { get; set; }

    /// <summary>
    /// 手机号码
    /// </summary>
    public string? MobilePhone { get; set; }

    /// <summary>
    /// 电话号码
    /// </summary>
    public string? Telephone { get; set; }

    /// <summary>
    /// 客户级别
    /// </summary>
    public int? CustomerLevel { get; set; }

    /// <summary>
    /// 客户状态
    /// </summary>
    public int? CustomerStatus { get; set; }

    /// <summary>
    /// 客户规格
    /// </summary>
    public int? CustomerSpecification { get; set; }

    /// <summary>
    /// 下次联系时间
    /// </summary>
    public DateTime? NextContactDate { get; set; }

    /// <summary>
    /// 下次联系时间范围
    /// </summary>
    public DateTime?[] NextContactDateRange { get; set; }

    /// <summary>
    /// 所在省
    /// </summary>
    public long? Province { get; set; }

    /// <summary>
    /// 所在市
    /// </summary>
    public long? City { get; set; }

    /// <summary>
    /// 区县
    /// </summary>
    public long? District { get; set; }

    /// <summary>
    /// 详细地址
    /// </summary>
    public string? DetailedAddress { get; set; }

    /// <summary>
    /// 最后跟进记录
    /// </summary>
    public string? LastFollowUpRecord { get; set; }

    /// <summary>
    /// 最后跟进时间
    /// </summary>
    public DateTime? LastFollowUpTime { get; set; }

    /// <summary>
    /// 最后跟进时间范围
    /// </summary>
    public DateTime?[] LastFollowUpTimeRange { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    public int? OrderNo { get; set; }

}

/// <summary>
/// CRM客户增加输入参数
/// </summary>
public class AddCRMCustomerInput : CRMCustomerBaseInput
{
    /// <summary>
    /// 客户名称
    /// </summary>
    [Required(ErrorMessage = "客户名称不能为空")]
    public override string CustName { get; set; }

    /// <summary>
    /// 客户来源
    /// </summary>
    [Required(ErrorMessage = "客户来源不能为空")]
    public override int CustomerSource { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [Required(ErrorMessage = "排序不能为空")]
    public override int OrderNo { get; set; }

    /// <summary>
    /// 软删除
    /// </summary>
    [Required(ErrorMessage = "软删除不能为空")]
    public override bool IsDelete { get; set; }

}

/// <summary>
/// CRM客户删除输入参数
/// </summary>
public class DeleteCRMCustomerInput : BaseIdInput
{
}

/// <summary>
/// CRM客户更新输入参数
/// </summary>
public class UpdateCRMCustomerInput : CRMCustomerBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }

}

/// <summary>
/// CRM客户主键查询输入参数
/// </summary>
public class QueryByIdCRMCustomerInput : DeleteCRMCustomerInput
{

}
